\subsection{Offline Tracking}
\label{sub:offline}
With the information from the above subsections we are now able to produce a trajectory of a given object.
An offline trajectory contains data of where the object have already moved.
To transform the data into a trajectory which we can make tracking quires we perform a three step refinement.

First the result with outputs type (\ref{log:offline}) is combined with the deployment graph.
We do this by extract all entries with the matching $objectID$, each entry is mapped to the deployment graph.
The result of this is a table where edges and cells from the Deployment Graphs is shown, see Figure~\ref{fig:ref1}.  

Next we revert the data such that we have the time intervals where object are not in sensor range also know as the vacant time interval.
In Figure \ref{fig:ref2} the three sensor reading are converted into two intervals where we know which cell the object is located in.

Lastly, we further limit the area of which the object is located in. 
We use the knowledge obtained in Section \ref{sec:speed} to limit the area based on two sensor points and the max speed of the object.
we know the object can only be in the intersection between the $A_{cell}$ and $A_{speed}$, see Figure \ref{fig:speed1}.
The result of the refinement can be seen in Figure \ref{fig:ref3}.
 


\begin{figure}
\begin{minipage}[tbh]{\columnwidth}

  \vspace*{\fill}
  \centering
		\begin{tabular}{ l  l  }
		\toprule
		\textbf{Interval} & \textbf{Location}\\ 
		\midrule
		$[t_1,t_2]$ & $c9$ \\ 

		$[t_6,t_{10}]$ &  $e\langle9,3\rangle$\\ 

		$[t_{21},t_{30}]$ &  $ e\langle3,9\rangle $\\ 
		\bottomrule
		\end{tabular}
  \caption{The data after refinement step 1, where c is a cell and e is a edge both known form the deployment graph.}
  \label{fig:ref1} \par\vfill
	
	
		\begin{tabular}{  l  l  }
		\toprule
		\textbf{Interval} & \textbf{Location}\\ 
		\midrule
		$[t_3,t_5]$ & c9 \\ 

		$[t_{11},t_{20}]$ &  c3\\ 
		\bottomrule
		\end{tabular}
  \caption{The data after refinement step 2.}
  \label{fig:ref2}
	
		\begin{tabular}{  l  l  }
		\toprule
		\textbf{Interval} & \textbf{Location}\\ 
		\midrule
		$[t_3,t_5]$ & c9 $\cap \Theta(reader_10,reader_8,t_1,t_2)$ \\ 

		$[t_{11},t_{20}]$ &  c3 $\cap \Theta(reader_8,reader_3,t_{10},t_{21})$\\ 
		\hline
		\end{tabular}
			
	\caption{The data after refinement step 3. }
  \label{fig:ref3}

\end{minipage}
\end{figure}


\subsection{Online Tracking}
\label{sub:online}
The purpose of online tracking is getting a precise estimate of where the object is currently located.
When tracking an object only its most recent log is used, recall the output (\ref{log:online}) which shows the format of this.
When $flag=START$ we know that the object is within the range of the sensor.
When $flag=END$ we calculate the intersection of $A_{cell}$ and $A_{speed}$. 
Remember that $A_{speed}$ is a function of time.  
